package design.simdi.code.final_paper.site.panels.licente.proiecte;

import org.apache.wicket.model.LoadableDetachableModel;

import design.simdi.code.final_paper.core.daos.ProjectDao;
import design.simdi.code.final_paper.core.entities.Project;

/**
 * 
 * @author Marius Dumitriu - (Jun 18, 2010 - 11:42:43 AM)
 * 
 */
public class DetachableProjectModel extends LoadableDetachableModel<Project> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final long id;
	private final ProjectDao projectDao;

	public DetachableProjectModel(Project object, ProjectDao projectDao) {
		super(object);
		this.id = object.getId();
		this.projectDao = projectDao;
	}

	@Override
	protected Project load() {
		return projectDao.get(id);
	}

}
